{% for comment in paginate.items %}
    <blockquote>
        <p class="show_modal"><a href="javascript:void(0);" data-url="{{ url_for('book_detail') }}"
              data-book_id="{{ comment.book_id }}" data-comment_id="{{ comment.id }}"
              data-toggle="modal" data-target="#modal-comment-book">{{ comment.content }}</a></p>
        <footer><<{{ comment.book.name }}>>&nbsp;&nbsp;&nbsp;{{ comment.from_user.username }}&nbsp;&nbsp;
            {% if comment.to_user %}
                <cite>回复</cite>&nbsp;&nbsp;{{ comment.to_user.username }}&nbsp;&nbsp;
            {% endif %}
            <cite>发表于</cite>&nbsp;&nbsp;&nbsp;{{ comment.publish_time }}
        </footer>
    </blockquote>

    {% if loop.last and paginate.pages>1 %}
        <nav aria-label="Page navigation">
            <ul class="pagination">
                <li class="aj">
                    <a {% if paginate.page!=1 %}href="#page{{ paginate.page - 1 }}"
                       data-href="{{ url_for('admin_comments_view',page = paginate.page - 1) }}"{% endif %}
                       aria-label="Previous">
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </li>
                {% if paginate.pages<10 %}
                    {% for page in range(paginate.pages) %}
                        <li class="aj"><a href="#page{{ page + 1 }}" data-id="page{{ page + 1 }}"
                                          data-href="{{ url_for('admin_comments_view',page=page + 1) }}">{{ page + 1 }}</a>
                        </li>
                    {% endfor %}
                {% else %}
                    <li class="aj"><a href="#page1" data-href="{{ url_for('admin_comments_view') }}">1</a> </li>
                    <li class="ellipsis">...</li>
                    {% for page in range(paginate.page - 3,paginate.page + 4) %}
                        <li class="aj"><a href="#page{{ page }}"
                                          data-href="{{ url_for('admin_comments_view',page=page) }}">{{ page }}</a>
                        </li>
                    {% endfor %}
                    <li class="ellipsis">...</li>
                    <li class="aj"><a href="#page1" data-href="{{ url_for('admin_comments_view',page=paginate.pages) }}">{{ paginate.pages }}</a> </li>
                {% endif %}

                <li class="aj">
                    <a {% if paginate.page!=paginate.pages %}href="#page{{ paginate.page + 1 }}"
                       data-id="page{{ paginate.page + 1 }}"
                       data-href="{{ url_for('admin_comments_view',page = paginate.page + 1) }}"{% endif %}
                       aria-label="Next">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>
            </ul>
        </nav>
    {% endif %}
{% endfor %}
{#    模态框 #}
<div class="modal fade modal-book-detail" id="modal-comment-book" tabindex="-1" role="dialog"
     aria-labelledby="exampleModalLabel">
</div>
